fix(api-server): register pre-auth interceptors when only GRPC_SERVICE_ACCOUNT is set#1455
Merged
mergify[bot] merged 1 commit intomainfrom Apr 24, 2026
Merged
Conversation
…E_ACCOUNT is set The init() guard from #1452 required AMBIENT_API_TOKEN to be non-empty before registering gRPC pre-auth interceptors. On Stage, only GRPC_SERVICE_ACCOUNT is set (no AMBIENT_API_TOKEN), so the interceptors were never registered and the OIDC service caller logic was dead code. Evidence from Stage api-server startup logs — no bearer token init messages appear, confirming early return at line 27-29: I0423 23:54:22.927314 Enabling JWT authentication middleware (no "Service token auth enabled" or "OIDC service account" log) Fix: register interceptors when either env var is set. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ Deploy Preview for cheerful-kitten-f556a0 canceled.
|
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated bearer-token gRPC interceptor registration logic in the middleware initialization to consider both Changes
🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Contributor
Merge Queue Status
This pull request spent 12 seconds in the queue, including 2 seconds running CI. Required conditions to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug in #1452: the
init()guard requiresAMBIENT_API_TOKENto be non-empty before registering gRPC pre-auth interceptors. On Stage, onlyGRPC_SERVICE_ACCOUNTis set —AMBIENT_API_TOKENis not in the api-server env vars — so interceptors are never registered and the OIDC service caller logic is dead code.Evidence
Stage api-server env vars (no
AMBIENT_API_TOKEN):Stage api-server startup logs — no bearer token init messages, confirming early return:
Runner pods still getting
PERMISSION_DENIEDonWatchSessionMessagesbecause the interceptor that would setCallerTypeServicewas never registered.Fix
Change
init()guard fromif token == ""toif token == "" && serviceAccount == ""— register interceptors when either env var is set.Test plan
OIDC service account username: ocm-ams-servicePERMISSION_DENIEDonWatchSessionMessages🤖 Generated with Claude Code
Summary by CodeRabbit